using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FetCo.Data;
using ADESSA.Business;
using ADESSA.Entities;
using FetCo.Framework;
using FetCo.Web;


public partial class Admin_MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        LoadUser(); ;
    }
    protected void LoadUser()
    {
        if (Session["userid"] != null)
        {
            Criteria criuser = new Criteria();
            criuser.add("[" + User._Table + "].[" + UserColumns.UserId + "]", long.Parse(Session["userid"].ToString()), Condition.EQUAL, Condition.AND);
            ADESSA.Entities.UserCollection _UserCollection = UserService.GetUserListByParam(UserColumns.UserId, OrderDirection.ASC, criuser.Criter);
            User _User = new User();
            if (_UserCollection.Count > 0)
            {
                _User = _UserCollection[0];
                aWellcom.InnerText = _User.FullName;
                aWellcom.HRef = "AddAccount.aspx?Id=" + _User.UserId.ToString();
                Permission _Permission = PermissionService.GetPermission(int.Parse(_User.PermissionId.ToString()));
                if (_Permission != null)
                {
                    //ltrPermisstionType.Text = _Permission.PermissionName;
                }
            }
        }
        else
        {
            Response.Redirect("~/Login.aspx");
        }
    }
  
}

